home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / insertSurfaceToolScript.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.4 KB  |  120 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  14 January 1999
  22. // Author:         sw
  23. //
  24. //
  25. //  Procedure Name:
  26. //      insertSurfaceToolScript
  27. //
  28. //  Description:
  29. //    create wrapper around the insertSurface command
  30. //
  31. //  Input Arguments:
  32. //        0 ==> do the command.
  33. //        1 ==> show the action option box
  34. //        2 ==> return the command
  35. //        3 ==> show tool option box
  36. //        4 ==> enter the tool
  37. //
  38. //  Return Value:
  39. //      None.
  40. //
  41.  
  42. global proc insertSurfaceToolSetup( int $forceFactorySettings,
  43.                                     string $goToTool )
  44. {
  45.     if( $forceFactorySettings || !`optionVar -ex insertSurfaceEuc` ) {
  46.         optionVar -iv insertSurfaceEuc 0;
  47.     }
  48.     if( $forceFactorySettings || !`optionVar -ex insertSurfaceLac` ) {
  49.         optionVar -iv insertSurfaceLac 1;
  50.     }
  51.     if( "" != $goToTool ) {
  52.         scriptCtx -e -euc `optionVar -q insertSurfaceEuc` $goToTool;
  53.         scriptCtx -e -lac `optionVar -q insertSurfaceLac` $goToTool;
  54.     }
  55. }
  56.  
  57. global proc insertSurfaceProperties()
  58. {
  59.     scriptCtxCommonProperties;
  60. }
  61.  
  62. global proc insertSurfaceValues ( string $toolName ) 
  63. {
  64.     performInsertKnot 3 "Surface" $toolName;
  65.     scriptCtxCommonValues( $toolName );
  66. }
  67. proc createInsertSurfaceContext( string $tool )
  68. {
  69.     if( ! `scriptCtx -exists $tool` ) {
  70.         insertSurfaceToolSetup( 0, "" );
  71.         scriptCtx -i1 "insert.xpm"
  72.           -title "Insert Isoparm Tool"
  73.           -bcn "insertSurface"
  74.  
  75.           -exitUponCompletion `optionVar -q insertSurfaceEuc`
  76.           -totalSelectionSets 1
  77.           -expandSelectionList true
  78.           -fcs ("insertSurfaceToolScript 0")
  79.  
  80.           -setNoSelectionPrompt ("Select isoparm to be inserted.")
  81.           -setSelectionPrompt ("Select another isoparm " +
  82.                                "or press ENTER to insert isoparm(s).")
  83.  
  84.           -setAutoToggleSelection true
  85.           -setAutoComplete `optionVar -q insertSurfaceLac`
  86.           -showManipulators true
  87.           -setSelectionCount 0
  88.           -isoparm true
  89.         $tool;
  90.     }
  91. }
  92.  
  93. global proc string performInsertKnotSrf( int $action,
  94.                                          string $goToTool )
  95. {
  96.     return performInsertKnot( $action, "Surface", $goToTool );
  97. }
  98.  
  99. global proc string insertSurfaceToolScript( int $setToTool )
  100. //
  101. //    Description :
  102. //        0 ==> do the command.
  103. //        1 ==> show the action option box
  104. //        2 ==> return the command
  105. //        3 ==> show tool/action option box
  106. //        4 ==> enter the tool/do the command
  107. {
  108.     string $tool = "";
  109.     if( $setToTool > 2 ) {
  110.         if( !`optionVar -q modelWithToolInsertSurface` ) {
  111.             $setToTool = 4 - $setToTool;
  112.         }
  113.         else {
  114.             $tool = "insertSurfaceContext";
  115.             createInsertSurfaceContext $tool;
  116.         }
  117.     }
  118.     return scriptToolScript( "performInsertKnotSrf", $setToTool, $tool );
  119. }
  120.